<template>
  <!-- <el-form :model="stuData" >
      <el-form-item label="sId">
        <el-input v-model="stuData[0].sId"></el-input>
      </el-form-item>

      <el-form-item label="name">
        <el-input v-model="stuData[0].name"></el-input>
      </el-form-item>

      <el-form-item label="class">
        <el-input v-model="stuData[0].class"></el-input>
      </el-form-item>

      <el-form-item label="city">
        <el-input v-model="stuData[0].city"></el-input>
      </el-form-item>

      <el-form-item label="productUrl">
        <el-input v-model="stuData[0].productUrl"></el-input>
      </el-form-item>

      <el-form-item label="age">
        <el-input v-model="stuData[0].age"></el-input>
      </el-form-item>
    </el-form> -->

  <el-table :data="stuData" border style="width: 100%"
    >             <el-table-column
      prop="headimgurl"
      align="center"
      label="头像"
      width="80"
      >                     <template slot-scope="scope">
                   <el-avatar
          shape="square"
          :size="50"
          fit="fill"
          :src="scope.row.headimgurl"
        ></el-avatar
        >                     
      </template>
               </el-table-column
    >
            <el-table-column
      prop="name"
      align="center"
      label="姓名"
      width="180"
    >
               </el-table-column
    >

          
    <el-table-column prop="class" align="center" label="班级"
      >               
    </el-table-column>

          
    <el-table-column prop="productUrl" align="center" label="项目"
      >                              </el-table-column
    >       </el-table
  >
</template>

<script>
import { getStuList } from "@/api";
export default {
  data() {
    return {
      stuData: [],
    };
  },
  mounted() {
    let id = this.$route.query.id;
    console.log("跳转过来的的信息", id);
    getStuList().then((res) => {
      // let id= this.$route.query
      let stu = res.data.data;
      console.log(stu);
      let stu2 = stu.filter((item) => {
        return item.sId === id;
      });
      console.log(stu2);
      this.stuData = stu2; // console.log(this.stuData[0].name);
    });
  },
};
</script>

<style scoped>
.el-main {
  text-align: left;
}
.el-input {
  width: 200px;
  margin-bottom: 5px;
  text-align: left;
}
</style>
